import request from "../utils/request";
import {apiDataType, apiIdType} from "types";
import qs from "qs";

// 列表
export function getTicket(data: apiDataType) {
    return request({
        url: '/grid/gridcenter/communityVenueGoods/list',
        method: 'post',
        headers: {'Content-Type': 'application/json'},
        data
    })
}

// 时段套餐列表
export function getTicketGoods(id: apiIdType) {
    return request({
        url: '/grid/gridcenter/communityVenueGoods/venueList',
        method: 'post',
        headers: {'Content-Type': 'application/x-www-form-urlencoded'},
        data: qs.stringify({id})
    })
}

// 编辑
export function updateTicket(data: unknown) {
    return request({
        url: '/grid/gridcenter/communityVenueGoods/update',
        method: 'post',
        headers: {'Content-Type': 'application/json'},
        data: data
    })
}

// 新增
export function insertTicket(data: unknown) {
    return request({
        url: '/grid/gridcenter/communityVenueGoods/insert',
        method: 'post',
        headers: {'Content-Type': 'application/json'},
        data
    })
}

// 详情
export function detailTicket(id: apiIdType) {
    return request({
        url: '/grid/gridcenter/communityVenueGoods/detail',
        method: 'post',
        headers: {'Content-Type': 'application/x-www-form-urlencoded'},
        data: qs.stringify({id})
    })
}

// 删除
export function deleteTicket(id: apiIdType) {
    return request({
        url: '/grid/gridcenter/communityVenueGoods/delete',
        method: 'post',
        headers: {'Content-Type': 'application/x-www-form-urlencoded'},
        data: qs.stringify({id})
    })
}